\(\int \frac {2+x^2}{(1+x^2) \sqrt {2+3 x^2+x^4}} \, dx\) [16]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [C] (verified)
   Fricas [C] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 27, antiderivative size = 48 \[ \int \frac {2+x^2}{\left (1+x^2\right ) \sqrt {2+3 x^2+x^4}} \, dx=\frac {\sqrt {2} \left (2+x^2\right ) E\left (\arctan (x)\left |\frac {1}{2}\right .\right )}{\sqrt {\frac {2+x^2}{1+x^2}} \sqrt {2+3 x^2+x^4}} \]

[Out]

(x^2+2)*(1/(x^2+1))^(1/2)*(x^2+1)^(1/2)*EllipticE(x/(x^2+1)^(1/2),1/2*2^(1/2))*2^(1/2)/((x^2+2)/(x^2+1))^(1/2)
/(x^4+3*x^2+2)^(1/2)

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.074, Rules used = {1470, 422} \[ \int \frac {2+x^2}{\left (1+x^2\right ) \sqrt {2+3 x^2+x^4}} \, dx=\frac {\sqrt {2} \left (x^2+2\right ) E\left (\arctan (x)\left |\frac {1}{2}\right .\right )}{\sqrt {\frac {x^2+2}{x^2+1}} \sqrt {x^4+3 x^2+2}} \]

[In]

Int[(2 + x^2)/((1 + x^2)*Sqrt[2 + 3*x^2 + x^4]),x]

[Out]

(Sqrt[2]*(2 + x^2)*EllipticE[ArcTan[x], 1/2])/(Sqrt[(2 + x^2)/(1 + x^2)]*Sqrt[2 + 3*x^2 + x^4])

Rule 422

Int[Sqrt[(a_) + (b_.)*(x_)^2]/((c_) + (d_.)*(x_)^2)^(3/2), x_Symbol] :> Simp[(Sqrt[a + b*x^2]/(c*Rt[d/c, 2]*Sq
rt[c + d*x^2]*Sqrt[c*((a + b*x^2)/(a*(c + d*x^2)))]))*EllipticE[ArcTan[Rt[d/c, 2]*x], 1 - b*(c/(a*d))], x] /;
FreeQ[{a, b, c, d}, x] && PosQ[b/a] && PosQ[d/c]

Rule 1470

Int[((d_) + (e_.)*(x_)^(n_))^(q_.)*((f_) + (g_.)*(x_)^(n_))^(r_.)*((a_) + (b_.)*(x_)^(n_) + (c_.)*(x_)^(n2_))^
(p_), x_Symbol] :> Dist[(a + b*x^n + c*x^(2*n))^FracPart[p]/((d + e*x^n)^FracPart[p]*(a/d + (c*x^n)/e)^FracPar
t[p]), Int[(d + e*x^n)^(p + q)*(f + g*x^n)^r*(a/d + (c/e)*x^n)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p,
q, r}, x] && EqQ[n2, 2*n] && NeQ[b^2 - 4*a*c, 0] && EqQ[c*d^2 - b*d*e + a*e^2, 0] &&  !IntegerQ[p]

Rubi steps \begin{align*} \text {integral}& = \frac {\left (\sqrt {1+x^2} \sqrt {2+x^2}\right ) \int \frac {\sqrt {2+x^2}}{\left (1+x^2\right )^{3/2}} \, dx}{\sqrt {2+3 x^2+x^4}} \\ & = \frac {\sqrt {2} \left (2+x^2\right ) E\left (\tan ^{-1}(x)|\frac {1}{2}\right )}{\sqrt {\frac {2+x^2}{1+x^2}} \sqrt {2+3 x^2+x^4}} \\ \end{align*}

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 10.17 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.96 \[ \int \frac {2+x^2}{\left (1+x^2\right ) \sqrt {2+3 x^2+x^4}} \, dx=\frac {2 x+x^3+i \sqrt {1+x^2} \sqrt {2+x^2} E\left (\left .i \text {arcsinh}\left (\frac {x}{\sqrt {2}}\right )\right |2\right )-i \sqrt {1+x^2} \sqrt {2+x^2} \operatorname {EllipticF}\left (i \text {arcsinh}\left (\frac {x}{\sqrt {2}}\right ),2\right )}{\sqrt {2+3 x^2+x^4}} \]

[In]

Integrate[(2 + x^2)/((1 + x^2)*Sqrt[2 + 3*x^2 + x^4]),x]

[Out]

(2*x + x^3 + I*Sqrt[1 + x^2]*Sqrt[2 + x^2]*EllipticE[I*ArcSinh[x/Sqrt[2]], 2] - I*Sqrt[1 + x^2]*Sqrt[2 + x^2]*
EllipticF[I*ArcSinh[x/Sqrt[2]], 2])/Sqrt[2 + 3*x^2 + x^4]

Maple [C] (verified)

Result contains complex when optimal does not.

Time = 1.56 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.67

method result size
risch \(\frac {x \left (x^{2}+2\right )}{\sqrt {x^{4}+3 x^{2}+2}}-\frac {i \sqrt {2}\, \sqrt {2 x^{2}+4}\, \sqrt {x^{2}+1}\, \left (F\left (\frac {i \sqrt {2}\, x}{2}, \sqrt {2}\right )-E\left (\frac {i \sqrt {2}\, x}{2}, \sqrt {2}\right )\right )}{2 \sqrt {x^{4}+3 x^{2}+2}}\) \(80\)
default \(\frac {\left (x^{2}+2\right ) x}{\sqrt {\left (x^{2}+1\right ) \left (x^{2}+2\right )}}-\frac {i \sqrt {2}\, \sqrt {2 x^{2}+4}\, \sqrt {x^{2}+1}\, \left (F\left (\frac {i \sqrt {2}\, x}{2}, \sqrt {2}\right )-E\left (\frac {i \sqrt {2}\, x}{2}, \sqrt {2}\right )\right )}{2 \sqrt {x^{4}+3 x^{2}+2}}\) \(81\)
elliptic \(\frac {\left (x^{2}+2\right ) x}{\sqrt {\left (x^{2}+1\right ) \left (x^{2}+2\right )}}-\frac {i \sqrt {2}\, \sqrt {2 x^{2}+4}\, \sqrt {x^{2}+1}\, \left (F\left (\frac {i \sqrt {2}\, x}{2}, \sqrt {2}\right )-E\left (\frac {i \sqrt {2}\, x}{2}, \sqrt {2}\right )\right )}{2 \sqrt {x^{4}+3 x^{2}+2}}\) \(81\)

[In]

int((x^2+2)/(x^2+1)/(x^4+3*x^2+2)^(1/2),x,method=_RETURNVERBOSE)

[Out]

x*(x^2+2)/(x^4+3*x^2+2)^(1/2)-1/2*I*2^(1/2)*(2*x^2+4)^(1/2)*(x^2+1)^(1/2)/(x^4+3*x^2+2)^(1/2)*(EllipticF(1/2*I
*2^(1/2)*x,2^(1/2))-EllipticE(1/2*I*2^(1/2)*x,2^(1/2)))

Fricas [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.14 (sec) , antiderivative size = 59, normalized size of antiderivative = 1.23 \[ \int \frac {2+x^2}{\left (1+x^2\right ) \sqrt {2+3 x^2+x^4}} \, dx=\frac {{\left (-i \, x^{2} - i\right )} E(\arcsin \left (\frac {1}{2} i \, \sqrt {2} x\right )\,|\,2) + {\left (i \, x^{2} + i\right )} F(\arcsin \left (\frac {1}{2} i \, \sqrt {2} x\right )\,|\,2) + 2 \, \sqrt {x^{4} + 3 \, x^{2} + 2} x}{2 \, {\left (x^{2} + 1\right )}} \]

[In]

integrate((x^2+2)/(x^2+1)/(x^4+3*x^2+2)^(1/2),x, algorithm="fricas")

[Out]

1/2*((-I*x^2 - I)*elliptic_e(arcsin(1/2*I*sqrt(2)*x), 2) + (I*x^2 + I)*elliptic_f(arcsin(1/2*I*sqrt(2)*x), 2)
+ 2*sqrt(x^4 + 3*x^2 + 2)*x)/(x^2 + 1)

Sympy [F]

\[ \int \frac {2+x^2}{\left (1+x^2\right ) \sqrt {2+3 x^2+x^4}} \, dx=\int \frac {x^{2} + 2}{\sqrt {\left (x^{2} + 1\right ) \left (x^{2} + 2\right )} \left (x^{2} + 1\right )}\, dx \]

[In]

integrate((x**2+2)/(x**2+1)/(x**4+3*x**2+2)**(1/2),x)

[Out]

Integral((x**2 + 2)/(sqrt((x**2 + 1)*(x**2 + 2))*(x**2 + 1)), x)

Maxima [F]

\[ \int \frac {2+x^2}{\left (1+x^2\right ) \sqrt {2+3 x^2+x^4}} \, dx=\int { \frac {x^{2} + 2}{\sqrt {x^{4} + 3 \, x^{2} + 2} {\left (x^{2} + 1\right )}} \,d x } \]

[In]

integrate((x^2+2)/(x^2+1)/(x^4+3*x^2+2)^(1/2),x, algorithm="maxima")

[Out]

integrate((x^2 + 2)/(sqrt(x^4 + 3*x^2 + 2)*(x^2 + 1)), x)

Giac [F]

\[ \int \frac {2+x^2}{\left (1+x^2\right ) \sqrt {2+3 x^2+x^4}} \, dx=\int { \frac {x^{2} + 2}{\sqrt {x^{4} + 3 \, x^{2} + 2} {\left (x^{2} + 1\right )}} \,d x } \]

[In]

integrate((x^2+2)/(x^2+1)/(x^4+3*x^2+2)^(1/2),x, algorithm="giac")

[Out]

integrate((x^2 + 2)/(sqrt(x^4 + 3*x^2 + 2)*(x^2 + 1)), x)

Mupad [F(-1)]

Timed out. \[ \int \frac {2+x^2}{\left (1+x^2\right ) \sqrt {2+3 x^2+x^4}} \, dx=\int \frac {x^2+2}{\left (x^2+1\right )\,\sqrt {x^4+3\,x^2+2}} \,d x \]

[In]

int((x^2 + 2)/((x^2 + 1)*(3*x^2 + x^4 + 2)^(1/2)),x)

[Out]

int((x^2 + 2)/((x^2 + 1)*(3*x^2 + x^4 + 2)^(1/2)), x)